﻿using System.ComponentModel.DataAnnotations;
using System;

namespace aspNetCURD.Dtos
{
    public class StudentCreationDto
    {
        /// <summary>
        /// 学号
        /// </summary>
        [Key]
        //[Required(ErrorMessage = "主键不能为空")]
        [MaxLength(9, ErrorMessage = "主键最大长度为 9")]
        public string sno { get; set; }
        /// <summary>
        /// 姓名
        /// </summary>
        [Required(ErrorMessage = "学生姓名不能为空")]
        [MaxLength(8, ErrorMessage = "学生姓名最大长度为 8")]
        public string sname { get; set; }
        /// <summary>
        /// 性别
        /// </summary>
        [Required(ErrorMessage = "学生性别不能为空")]
        [MaxLength(1, ErrorMessage = "学生性别最大长度为 1")]
        public string ssex { get; set; }
        /// <summary>
        /// 出生日期
        /// </summary>
        public DateTime? birthday { get; set; }
        /// <summary>
        /// 入学日期
        /// </summary>
        public DateTime? en_time { get; set; }
        /// <summary>
        /// 专业
        /// </summary>
        [MaxLength(10, ErrorMessage = "专业最大长度为 10")]
        public string specialty { get; set; }
        /// <summary>
        /// 年级
        /// </summary>
        [Required(ErrorMessage = "学生年级不能为空")]
        [MaxLength(5, ErrorMessage = "年级最大长度为 5")]
        public string grade { get; set; }
    }
}
